package com.project.client.domain;


import java.math.BigDecimal;
import java.util.Date;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.project.common.annotation.Excel;
import com.project.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 温度记录数据对象 c_centigrade_record
 *
 * @author project
 * @date 2021-05-10
 */

@TableName("c_centigrade_record")
public class CentigradeRecordEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @TableId
    private Long id;

    //温度/摄氏度
    @Excel(name = "温度/摄氏度",sort =  3)
    @NotNull(message = "缺少温度信息")
    private Float centigrade;

    //日期
    @JSONField(format = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd",sort =  2)
    @NotNull(message = "缺少日期信息")
    private Date recordDate;

    @Excel(name = "城市" ,sort =  1)
    @TableField(exist = false)
    private String areaName;

    //城市code
    @NotBlank(message = "缺少城市信息")
    private String areaCode;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Float getCentigrade() {
        return centigrade;
    }

    public void setCentigrade(Float centigrade) {
        this.centigrade = centigrade;
    }

    public Date getRecordDate() {
        return recordDate;
    }

    public void setRecordDate(Date recordDate) {
        this.recordDate = recordDate;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("centigrade", getCentigrade())
                .append("record_date", getRecordDate())
                .append("areaCode", getAreaCode())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}